//
//  MerChentCollectionViewCell.m
//  gpos_app
//
//  Created by 崔航飞 on 2018/8/19.
//  Copyright © 2018年 apple. All rights reserved.
//

#import "MerChentCollectionViewCell.h"
#import "UIImageView+WebCache.h"
@implementation MerChentCollectionViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    

}

-(void)setModels:(MerChantModel *)models{
    NSString *str;
   
    if (models.picture.count==0) {
      str=@"";
    }else{
        
        str  = [models.picture[0] objectForKey:@"uri"];
    }
    
    // 对URL字符串进行 URL 编码，避免中文乱码问题
//    NSString *urlStr = [models.pictuers stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    NSString *urlStr = [str stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    self.topView.contentMode=UIViewContentModeScaleAspectFill;
    self.topView.clipsToBounds=YES;
    if (str==nil)
    {
        self.topView.image=[UIImage imageNamed:@"icon_sjt_zw"];
    }else{
        
         [self.topView sd_setImageWithURL:[NSURL URLWithString:urlStr] placeholderImage:[UIImage imageNamed:@"icon_sjt_zw"]];
        
    }
   

    self.nameLab.text=[NSString stringWithFormat:@"%@",models.name];
    self.FLLab.text=[NSString stringWithFormat:@"%@",models.type];
    self.FLLab.layer.backgroundColor=[UIColor blueColor].CGColor;
    self.FLLab.layer.cornerRadius=3;
//    self.addressLab.text=[NSString stringWithFormat:@"%@",models.address];
    self.addressLab.text=models.address;

    self.phoneNumLab.text=[NSString stringWithFormat:@"%@",models.phone];
    
    self.JGlable.text=models.descript;
    self.JGlable.layer.borderColor=[UIColor blueColor].CGColor;
    self.JGlable.layer.borderWidth=0.7;
    self.JGlable.layer.cornerRadius=5;
   
    
}

@end
